<html>
<head>
  <title>Stats for {{ username }}</title>
  <link rel="stylesheet" type="text/css" href="/static/style.css" />
</head>
<body>
<h1>Stats for {{ username }}</h1>
Total screenings: {{ total_screenings }}
<br>Screenings since account inception: {{ screenings_inception }}
<br>Screenings attended: {{ attended }}
<br>Screenings missed since account inception: {{ missed }}
<br>Screenings attended out the last 5 recent ones: {{ attended_recent }}
<br>Screenings missed out the last 5 recent ones: {{ missed_recent }}
<br>Vote weight: {{ weight }}
<pre>
>>> attended
{{ attended }}
>>> missed
{{ missed }}
>>> attended_recent
{{ attended_recent }}
>>> missed_recent
{{ missed_recent }}
>>> all_time_score = max(-0.5, min(0.5, 0.05 * (attended - missed)))
>>> all_time_score
{{ all_time_score }}
>>> recent_score = 0.1 * (attended_recent - missed_recent)
>>> recent_score
{{ recent_score }}
>>> lock = {{ lock }}
>>> max(0, min(1, lock + all_time_score + recent_score))
{{ weight }}
</pre>

<h1>Details</h1>
<p>
Given:
</p>
<ul>
  <li><code>attended</code> = number of screenings attended
  </li>
  <li><code>missed = number</code> of screenings missed
  </li>
  <li><code>attended_recent</code> = number of past 5 screenings that were
  attended
  </li>
  <li><code>missed_recent</code> = number of past 5 screenings that were missed
  </li>
</ul>

<p>
Vote weightings are calculated as follows:
</p>

<code><pre>
all_time_score = max(-0.5, min(0.5, 0.05 * (attended - missed)))
recent_score = 0.1 * (attended_recent - missed_recent)
lock = attended >= 1 ? 0.5 : 0

vote value = max(0, min(1, lock + all_time_score + recent_score))
</pre></code>
<p>
This produces a weight that has the following characteristics:
</p>

<ul>
  <li>The weight is between 0 and 1, inclusive.
  </li>
  <li>The weight is always 0 for people who have never attended a screening.
  (This reduces the incentive to register lots of extra accounts to try to tip
  the vote.)  Once you have attended a screening, your neutral weight casts a
  weak vote (0.5).
  </li>
  <li>Each users's historic attendance is taken into account, and can cause a
  maximum modification of plus or minus 0.5 to their weight.
  </li>
  <li>Each user's recent attendance is taken into account, and can account for
  another plus or minus 0.5 to their weight.
  </li>
</ul>
</body>
</html>
